The problem is quite simple: the first time the popup panel is rendered, it has an incorrect size. By incorrect, I mean that it's size is computed as if the image had a 0 size. I had a look to what happened in the browser, and I could see that the size of the popup panel is computed before the image is actually loaded. Then, when the popup panel is rendered again later, it has a correct size, because the image is in the browser cache.
Do I have a mean to tell richfaces to compute the size of the popup panel after the image is loaded?