# XML photo gallery displaying images wrongly

**URL:** <https://forum.kirupa.com/t/xml-photo-gallery-displaying-images-wrongly/257473>\
**Category:** flash\
**Created:** [April 14, 2008, 4:22pm UTC](https://forum.kirupa.com/t/xml-photo-gallery-displaying-images-wrongly/257473 "2008-04-14T16:22:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommiwalsh](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@tommiwalsh](https://forum.kirupa.com/u/tommiwalsh)\
**Post date:** [April 14, 2008, 4:22pm UTC](https://forum.kirupa.com/t/xml-photo-gallery-displaying-images-wrongly/257473/1 "2008-04-14T16:22:47Z")

</div>

Hi,

I did the ‘Photo Gallery using XML and Flash’ tutorial on here, and it all worked great, until I added some more images to my photo list which weren’t exactly the same width as all my original ones. Now the ones that are not so wide leave big gaps and appear where they like (often on top of other images)… I’m pretty sure this is the section of code that needs adjusting, I just can’t work out what to change to fix it?-

```auto
function thumbnails_fn(k) {
	thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
	tlistener = new Object();
	tlistener.onLoadInit = function(target_mc) {
		target_mc._x = hit_left._x+(target_mc._width+5)*k;
		target_mc.pictureValue = k;
		target_mc.onRelease = function() {
			p = this.pictureValue-1;
			nextImage();

```

Any help would really be appreciated as I need to get this fixed asap…

Cheers,

Tom
