FIX: Gallery

Ready for review/merge.
In other words. This was an ugly bug and you fixed it :)