Adding Thumbnails - Thumbnail order problems

I have built a thumbnail gallery based on the tutorial on this site. It works great, but I’m having trouble with my thumbnails loading in order. I have seen posts similar to mine, but they have not resolved my question.

I am calling images from an xml file, and placing them in a horizontal scrollbar. All of my thumbnails are different widths. Therefore, I need to be able to get the width of each thumbnail to position it in relation to the one before it and so on. Because of this, I’m using onLoadInit to position the images. Now, this creates a random horizontal order, based on how fast they load on the user’s computer, not on their order in the xml file. I would use onLoadStart or onLoadComplete, as this would call them in that order, but the width is not available at this point in the loading, so they pile on top of each other. I haven’t figured a way out of this. Hopefully someone will have some suggestions.

Thanks, Adam.