An image slider in javascript and php to get the images dynamically