Revert "Update gallery.js"

This reverts commit 095b8af86f1a92825848c235040eabfe876b80f4.