galleryArray = new Array();
galleryArray[0] = "image1.html";
galleryArray[1] = "image2.html";
descriptionArray = new Array();
descriptionArray[0] = "description1.xml";
descriptionArray[1] = "description2.xml";
As you may imagine from looking at that code snippet, the galleryArray holds all our image.html url information, while the descriptionArray holds our description.xml information. One array is going to load the images, the other some description of the image.
To change files all you would need to do is change the array pointer to reflect a new file. It keeps things nice and simple. Well at least for me it does. Then later we cycle through the arrays to obtain the correct files.