Fix bug where Firefox wouldn't switch galleries