Fixed bug with fast gallery buttion click during mode switching.