Fixed crash when user switches to gallery too fast