Actionscript—photo gallery tweaking

hi everyone! i designed a photo gallery for a photographer’s website, using the tutorial found here: (you can view the actual site at everything works perfectly and the client loves it, but the only problem is this—if the vertical pictures are centered, then the horizontal ones are off-center, and vice versa. i’m sure there’s some actionscript that can fix this, maybe a conditional statement or something? something along the lines of

if (photo_mc._width > 300){
photo_mc._x = -200;
photo_mc._x = 0;

although this code didn’t actually work, i think it would be something like this. can anyone help me? thank you so much in advance, i really appreciate it.