Bug fixes on the photo gallery script; started with XML implementation