Pop up window size

I’ve searched and found several post about pop ups but i don’t see any that ask about setting the size or in this case not setting it.

in the tut http://kirupa.com/developer/mx/centered_popup.htm you have to input the images size. Is there anyway where you don’t have to do that and let the script do that by just loading the image and fitting itself around the image?