Refactored gallery