refactor gallery rendering without partial to run tests