allow slideshow to work with galleries that specify IDs. ID order is preserved