Removed excess code from viewPhotos