Correct control of empty galleries