gallery layout improvements