bug fix when moving between gallery and galleries view