add key bindings for closing gallery or switching to next or previous image