Update Gallery Switch

The switch between gallery and single file output is improved. Also done
are some minor maintenances without effect.