Centering Dynamic Images in XML Gallery

Hey there folks, I’m having an issue centering dynamically loaded content, if anyone could take a look at this gallery movie I’m working on I would appreciate it.

http://www.citruswebhosting.com/web-test/imgCenter.zip

Heres the AS for the gallery, I’m trying to center each image upon loading it into the img container.

var cx = loader._x;
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
    //portfolioTag = this.firstChild;
    numimages = this.firstChild.childNodes.length;
    spacing = 50;
    for (i=0; i<numimages; i++) {
        this.picHolder = this.firstChild.childNodes*;
        this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
        this.thumbHolder._x = i*spacing;
        this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
        this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
        this.thumbHolder.title = this.picHolder.attributes.title;
        this.thumbHolder.main = this.picHolder.attributes.main;
        this.thumbHolder.onRelease = function() {
            loader.loadMovie(this.main);
            loader._x = cx-loader._width/2;
            };
        }    
        
            
    };

myPhoto.load("xmlphoto.xml");

bump, would really appreciate some help with this code. Thanks in advance!
-alex