This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
So, if the exception says that the line contains an array list with size=0, and getUsers is the only list in that line, then it must follow that get Users returns a list with 0 elements. You should look at what getUsers returns and how it's populated. You haven';t posted the code that populates the users list. If you post that code, it will help.
The simplest and most portable way to display an image on a JSF View is to use the h:graphicImage tag, where you supply a URL which in turn invokes a servlet that will return the image you want.
However, for RichFaces users the a4j:mediaOutput tag can be very useful. It is, however, a challenge to get working right.
Some things that will probably make the job easier:
1. Consider using a h:dataTable instead of an a4j:repeat. Or at least consider using a ui:repeat, if you cannot be persuaded to use a dataTable. There is no virtue in using obsolete extensions to JSF once the functions they provide have become incorporated into the standard.
2. Don't attempt to do all the work in paint1 in a single line of code. The compiler isn't going to make less efficient code if you break it up into multiple statements, and it is easier to debug if the functions are all separate statements where a debugger can examine what each one does one at a time.
An IDE is no substitute for an Intelligent Developer.