refactored viewing the image and making it scroll