Variable image width for XML gallery

Hi All

I’m a bit new to actionscripting and i managed to find a tutorial online for a horizontal image scroller, which works great, however i need the images (which are loaded in via an xml doc.) to be of varying widths. I need the images to load directly after each other. At the moment if the image width is less then the defined width it will leave a gap between images and if the image is to large then it will be hidden behind the following image. I understand that the x-pos needs to be defined in the actionscript so that flash knows where to append the images in the scroller. But is there any way to define the width say in the xml document and then get flash to read the dimensions of the images from the xml and append the images in the scroller accordingly? I’ve attached my source files below for reference.

If anyone can point me in the right direction that would be great!!