This js will control an image gallery