makes several fixes to gallery