gallery check in template