Next button working for gallery