I regret this method of generating galleries