XML photo gallery issues

Hi gang
I am building an XML photo gallery, inspired by the tutorial on this site. It works fine, however, I am coming across an issue when I want to have my thumbnails wrap on the flash movie rather than running off the stage and unvisible to the user.

I was wondering if there is something I can do to the actionscript or the flash file to modify it so that as more images get added to the stage, either the thumbnails wrap and/or a scroll bar appears…

Here is the code

XML file:

 <gallery>
<image title="Image 1" main="one.jpg" thmb="1thumb.jpg"/> 
<image title="Image 2" main="two.jpg" thmb="2thumb.jpg"/> 
<image title="Image 3" main="three.jpg" thmb="3thumb.jpg"/>
<image title="Image 4" main="four.jpg" thmb="4thumb.jpg"/>
<image title="Image 5" main="five.jpg" thmb="5thumb.jpg"/>
<image title="Image 6" main="six.jpg" thmb="6thumb.jpg"/>
</gallery>

Actionscript in Flash

 myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("xmlphoto.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 50;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes*;
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
thumbHolder._x = i*spacing;
thumbHolder.title = picHolder.attributes.title;
thumbHolder.main = picHolder.attributes.main;
thumbLoader = thumbHolder.createEmptyMovieClip("thumbnail_image"+i, i);
thumbLoader.loadMovie(picHolder.attributes.thmb);
//create new movie and then load the thumbnails into it.
thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
};


On the stage I have 2 movie clips with instance names of “loader” (which populates the image" “thumbnails” (which populates the thumbnails) and a dynamic textfield for the image title.

Thanks. Greatly appreciated.