Refactor: Extract methods in GalleryActivity.