Loading unknown JPEG with standard size

Hi you all!

I made a guestbook formular for my website and would like that the visitors have the possibility to insert a photo in it.
The problem is, that I don´t know the picture’s size the user want to upload. How can I show it in a standard size in my guestbook.

I though in this possibility:
[font=Courier New]
//“photo” is the movie target -> it contains just a shape
// “filename” is a variable with the filename String
var new_width = getProperty(_root.photo,_width);
var new_height= getProperty(_root.photo,_height);

//try to find the new scale factor for both axis :confused:
// I want a pic with 150 x 200 pixels
while((new_width > 200) || (new_height > 150))
scale = scale - 1;
new_width = new_width * scale / 100;
new_height = new_height * scale / 100;

// then try to resize the movie, but it doesn´t work :eek:

So, I hope somebody can help me in this case… I really don´t have any idea, what could be the problem in this code…