How to display images in center in xml slide show

I have created a flash animation using tutorial on kirupa.com
http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm
The problem I am facing is my images are of different size, so how to display images in center.

I have used this code, it displays images in center in IE but in firefox it displays
half image

if (picture._alpha<100) { 
        picture._alpha += 10; 
        picture._x = (Stage.width/2) - (picture._width/2);
        picture._y = 40;
    }

Kindly provide solution for this