more refactor gallery partial template