XML gallery image centering in Flash

I’m using parital XML code found on Kirupa earlier this year but I’m having problems centering the image in the middle of the screen after the target thumbnail is clicked. I’ve found a prototype code to handle this but it produces unexpected results on the server side-- everything in the Flash/IE/Mozilla preview browsers work perfectly fine ‘offline’. As soon as I place it on the server the movieclip will sometimes center tiny in the middle of the screen forcing the image off to the bottom right!??

http://johnsolskei.com/suhrtest/thumb_resize.html

Does anyone know why this would occur? This is tough to troubleshoot because the movie loads just fine in the Flash 8 preview browser. Maybe someone has had similar problems or knows why it would react this way in the online browser? Any help is greatly appreciated! -John

//////XML acknoledgements to Kirupa Chinnathambi///////
///////////////////////////////////////////////////////
function loadXML(loaded) {
 if (loaded) {
  xmlNode = this.firstChild;
  image = [];
  description = [];
  thumbnails = [];
  total = xmlNode.childNodes.length;
  for (i=0; i<total; i++) {
   image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
   description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
   thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
   thumbnails_fn(i);
  }
 } else {
  content = "file not loaded!";
 }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
///////////////////////////////////////////////////////
border_mc._visible=false;
p = 0;
this.onEnterFrame = function() {
 filesize = picture.getBytesTotal();
 loaded = picture.getBytesLoaded();
 preloader._visible = true;
 if (loaded != filesize) {
  preloader.preload_bar._xscale = 100*loaded/filesize;
 } else {
  preloader._visible = false;
  if (picture._alpha<100) {
   picture._alpha += 10;
  }
 }
};
function nextImage() {
 if (p<(total-1)) {
  p++;
  if (loaded == filesize) {
   picture._alpha = 0;
   //picture.loadMovie(image[p], 1);
   picture.loadPic(image[p], 1);
   desc_txt.text = description[p];
   picture_num();
  }
 }
}
function prevImage() {
 if (p>0) {
  p--;
  picture._alpha = 0;
  //picture.loadMovie(image[p], 1);
  picture.loadPic(image[p], 1);
  desc_txt.text = description[p];
  picture_num();
 }
}
function thumbnails_fn(k) {
 thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
 tlistener = new Object();
 tlistener.onLoadInit = function(target_mc) {
  target_mc._x = (target_mc._width-45)*k;
  target_mc.pictureValue = k;
  if ((k+5)%2 == 0) {
   target_mc._x = ((target_mc._width-45)*k)+75;
   target_mc._y += 75;
  } else {
   target_mc._x += 100+30;
  }
  target_mc.onRelease = function() {
   dimmer_mc._visible=true;
   dimmer_mc.gotoAndPlay("on");
   border_mc._visible=true;
   p = this.pictureValue-1;
   nextImage();
   };
  target_mc.onRollOver = function() {
   this._alpha = 50;
  };
  target_mc.onRollOut = function() {
   this._alpha = 100;
  };
 };
 image_mcl = new MovieClipLoader();
 image_mcl.addListener(tlistener);
 image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
//////resizing border and moving the image to the center///////////
///////////////////////////////////////////////////////////////////
spacing = 10;
MovieClip.prototype.loadPic = function(pic){
 _root.picture._alpha = 0;
 this.loadMovie(pic);
 _root.onEnterFrame = function(){
  var t = picture.getBytesTotal(), l = picture.getBytesLoaded();
  if (t != 0 && Math.round(l/t) == 1){
   var w = picture._width + spacing, h = picture._height + spacing;
   border_mc.resizeMe(w, h);
   delete _root.onEnterFrame;
  }
 }
};
MovieClip.prototype.resizeMe = function(w, h){
 var speed = 3;
 this.onEnterFrame = function(){
  this._width += (w - this._width)/speed;
  this._height += (h - this._height)/speed;
  if( Math.abs(this._width-w)<1){
   this._width = w;
   this._height = h;
   _root.picture._x = this._x - this._width/2 + spacing/2;
   _root.picture._y = this._y - this._height/2 + spacing/2;
   _root.picture._alpha = 100;
   delete this.onEnterFrame;
  }
 }
};