gallery slide working for any number of items