Centering Images in Slideshow

i,
I am new to AS and Flash. I am trying to get an XML based Flash CS3 slideshow to work. I have got most of it going but have one key problem:
My stage is 320 x 240 I have a variety of images some smaller that 320 in width. The ones less that 320 in width get drawn on the left hand side of the stage NOT the centre.
I would like all images to be drawn in the centre not on the left.
Here is the code


private function getMask():MovieClip
        {
            mask_mc=new MovieClip();
            mask_mc.graphics.beginFill(0xFF3366,1);
            mask_mc.graphics.drawRect(-.5,-.5,1,1);
            mask_mc.x=stage.stageWidth/2;
            mask_mc.y=stage.stageHeight/2;
            

            addChild(mask_mc);
            masks_array.push(mask_mc);
            return mask_mc;
        }
        
        private function openMask():void
        {
            mask_mc.addEventListener(Event.ENTER_FRAME,openX);
        }
        
        private function openX(evt:Event):void
        {
            var arrX:Number=clips_array[id].width/2; 
            var dx:Number=arrX-evt.target.width; 
            var ax:Number=dx*.3;
                
            evt.target.width+=ax;
            if(Math.abs(dx)<=.2)
            {
                mask_mc.removeEventListener(Event.ENTER_FRAME,openX);
                evt.target.width=arrX;
                mask_mc.addEventListener(Event.ENTER_FRAME,openY);
            }
        }
        
        private function openY(evt:Event):void
        {
            var arrY:Number=clips_array[id].height/2; 
            var dy:Number=arrY-evt.target.height;
            var ay:Number=dy*.2;
            evt.target.height+=ay;
            if(Math.abs(dy)<=.3)
            {
                mask_mc.removeEventListener(Event.ENTER_FRAME,openY);
                evt.target.height=arrY;
                mask_mc.addEventListener(Event.ENTER_FRAME,reOpenX);
            }
        }
        
        private function reOpenX(evt:Event):void
        {
            /* var arrX:Number=clips_array[id].width; */
            var arrX:Number=clips_array[id].width;
            var dx:Number=arrX-evt.target.width;
            var ax:Number=dx*.3;
            evt.target.width+=ax;
            if(Math.abs(dx)<=.2)
            {
                mask_mc.removeEventListener(Event.ENTER_FRAME,reOpenX);
                evt.target.width=arrX;
                mask_mc.addEventListener(Event.ENTER_FRAME,reOpenY);
            }
        }
        
        private function reOpenY(evt:Event):void
        {
            var arrY:Number=clips_array[id].height;
            var dy:Number=arrY-evt.target.height;
            var ay:Number=dy*.3;
            evt.target.height+=ay;
            if(Math.abs(dy)<=.2)
            {
                mask_mc.removeEventListener(Event.ENTER_FRAME,reOpenY);
                evt.target.height=arrY;
                initTimer();
            }
        }
        

Can someone tell me what I need to change here to produce the images in the centre and not the left.

Thx for any help.