Gallery switch bug fixed