Picture Gallery and thumbnail doubts

Here’s the situation: I’m making a script that will dynamically load JPG’s from a file and will eventually display each JPG’s thumbnail them side by side. I’ve got the code going and would like to know any suggestions for corrections.
[AS]
**// Importing Images

p = 0;
x = 20;
y = 20;
for(i=0;i<4;i++){
_root.createEmptyMovieClip(“clip”+i, i+1)
loadMovie(“pic”+i+’.jpg’,_root[“clip”+i]);
_root[“clip”+i]._x = x;
_root[“clip”+i]._y = y;

            //attempt to change position for next image
             x = +100;
 y = +100;

}

_root.onEnterFrame = function(){
            _root["pic"+p+'.jpg'].swapDepths(_root);
             
                         //attempt to create thumbnails
                         if(this._width&gt;768){
	this._width = 150;
                            this._height = 113;
             }
             else {
	this._width = 150;
                            this._height = 200;
             }
            p++;
}

**[/AS]
Right now I’m having troubles with the resizing of images: the if statement doesn’t seem to work (or maybe resizing in flash distorts the images). Any tips or suggestions for the code?

Thanks!! :pleased: