Image Gallery - question

Hi everybody,
first of all I want to thank u for this wonderful site… I find everyday a lot of interesting articles.
I have a question for u on Image gallery.
I would like to scale images to a defined width and proportionally scale height, without modify proportions.
Actually the loader clip doesn’t have any dimension (0,0) and changing to another dimension doesn’t work (no image is shown).
So I made a trick: I put a trasparent rectangle into loader and it worked properly.
Next step: I need to know if images are portrait or landscape in order to scale in the right way to fit into the stage… I don’t know how to get image dimensions while or after loaded.
Can u help me?

thanks

Angelo