defect on gallery template fix