Auto resize images

I’m creating a dynamic photo gallery. All of the images are in a folder which I access via an xml file to get the pictures to show up when I click them. This makes things alot more convenient. However, the pictures come in varying sizes and because I use the same mask/stage to display all of the pictures I need them to be all similar dimensions. I don’t want to just mass resize all of them b/c they aren’t the same proportions. Is there a way to get flash to make the picture be a certain size but keep its proportions

To get the picture to show up on stage I have a movieclip and I use the following code:

picture.loadMovie(image[p], 1);//attach actual picture to first level of movieclip

picture is the name of the movieclip and image is an array of pictures