Help with basic AS please - dynamic image proportions

I am having trouble with a script that was purchased for a clients site, it draws thumbnails within a scroller component. I need the images to be aligned x and y axis differently based on whether they are portrait (29px H) or landscape (122px H). I have tried if and else statements to no avail :confused;

What currently sets layout of thumbs:

curMC._x=myCol*(curMC._width+50);
curMC._y=myRow*(curMC._height+80);

Start of code
//////////////////////

function createClip(i){
skin = “0”;
var attachWhat:String = (useThumbnails==“true”) ? “skin”+skin+"_thumbnail" : “skin”+skin+"_galItem";
thumbLoader.content.attachMovie(attachWhat,“gal”+i,i);
var curMC:MovieClip = thumbLoader.content[“gal”+i];
curMC._alpha=0;
if(useThumbnails==“true”){
var imageStuff:Array = String(myArray*[0]).split("/");
var myThumb:String = curGalDir+"/thumbs/"+(imageStuff[imageStuff.length - 1]);
curMC.image_mc.loadMovie(myThumb);
var tmpMC:MovieClip = curMC._parent.createEmptyMovieClip(“tmp”+i, i+10000);
tmpMC.onEnterFrame=function(){
if((curMC.image_mc.getBytesLoaded()==curMC.image_mc.getBytesTotal())&&curMC.image_mc.getBytesTotal()>50){
curMC.image_mc._x-=(curMC.image_mc._width/2);
curMC.image_mc._y-=(curMC.image_mc._height/2);
delete this.onEnterFrame;
}
}
}
curMC.current_mc._alpha=0;
curMC.i = i;
animateIn(curMC, 100, “_alpha”, 30);
curMC.myImage=myArray*[0];
curMC.i=i;
curMC._x=myCol*(curMC._width+50);
curMC._y=myRow*(curMC._height+80);
var colMax:Number = (useThumbnails==“true”) ? columns_thumbs : columns_no_thumbs ;
if(myCol==colMax)myRow++;
myCol=(myCol<colMax)? myCol+1 : 0;
curMC.onRollOver=function() {
if(galEnabled!=0)animateIn(this.btn1_mc, 15, “frame”, 15);
}
curMC.onRollOut=function() {
if(galEnabled!=0)animateOut(this.btn1_mc, 0, “frame”, 15);
}
curMC.onRelease=function(){
if(galEnabled!=0){
picClick=1;
if(currentMC!=this){
animateOut(currentMC.current_mc, 0, “_alpha”, 30);
currentMC=this;
animateIn(currentMC.current_mc, 100, “_alpha”, 30);
}
whichPic = this.i;
setFrame();
this.photoSelected1_mc._visible = true;
animateIn(this.photoSelected1_mc, 100, “_alpha”, 15);
}
}
if(i==myLength-1){
galleryCombo.enabled=true;
setFrame();
var galleryWait_int=setInterval(checkWait, 500);
}
thumbLoader.size();
clearInterval(gallery[“myInt”+i]);
}