Fix bug in gallery