Help!Photo Gallery Using XML and Flash

Hi, i’m new in action scripting

i recently did a flash web with this tutorial

the problem is, i cant auto align the image into center of the stage. the tutorial only did for 1 size image. but i got 2 different size image which make 1 of the size not in center.

can anybody add the script for me?Thanks