cleanup gallery conditionals