Creating sprite behind image

Hey,

I’m trying to build a picture viewer that can be used in every way. So it’s important for me to make everything dynamic. I have a xml file that I load and then I read all the images and I want a border surrounding the image. I’ve made a new sprite to load everything in, I made a second sprite to load the images and that second sprite should be behind every image but it will only show behind the first image. So please help me! What should I do???

<code>
main_container = new Sprite();
main_container.x=containerX;
main_container.y=containerY;
addChild(main_container);

sub_container = new Sprite();
sub_container.x=thumbsX;
sub_container.y=thumbsY;
sub_container.graphics.beginFill(0x969696);
sub_container.graphics.drawRect(10, 10, 52, 52);

for (i = 0; i &lt; my_total; i++) {

    thumbs.buttonMode=true;

    sub_container.addChild(thumbs);
    sub_container.addChild(titles);
    var thumb_url=my_picture*.url;
    //trace(thumb_url);
    thumb_loader = new Loader();
    thumb_loader.name=i;
    //trace(thumb_loader.name);
    thumb_loader.load(new URLRequest(thumb_url));
    thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
    thumb_loader.x = (thumbWidth+5)*i;

    var thumb_title=my_picture*.note;
    var title_txt:TextField = new TextField();
    title_txt.text=thumb_title;
    title_txt.x=thumb_loader.x;
    title_txt.y=thumbHeight+10;
    title_txt.width=thumbWidth;
    title_txt.height=25;
    title_txt.wordWrap=true;
    //title_txt.text.TextFieldAutoSize.CENTER;
    titles.addChild(title_txt);
    main_container.addChild(sub_container*);


}

</code>