added full functionality of the buttons of photo-viewer