Fixed issues with gallery keyboard navigation