Refactored gallery into proper plugin