Preloader Problems w/ Photo Gallery

Hi:

I’m building a photo gallery with the following code being a sample for each image. Unwieldy, I know. My preloader (just the component preloader in Flash) is called my_pb. Dancers is the name of the thumbnail/button, and MC is a movie clip that contains myLoader.

The code works, except that when I change pages and bring up a photo, I get an error that says: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:: DisplayObjectContainer/removeChild()

I don’t get this when I just move around between various photos on the same page. I even tried introducing a different preloader for each page, but that didn’t change anything.

I’d really appreciate any help on this. Thanks a lot!

dancers.addEventListener (MouseEvent.CLICK, peldr1a)
function peldr1a(e:Event) {
myLoader.load(new URLRequest(“pictures/Performance/pink dancers.jpg”));
addChild(my_pb);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler_dancers);
MC.addChild(myLoader);
}
function completeHandler_dancers(event:Event):void {
TransitionManager.start(event.target.loader.parent , {type:Fade, direction:Transition.IN, duration:1, easing:Strong.easeOut});
removeChild(my_pb);
}