Removed a bug in gallery guts