Fixed problem with script dependicies on the template gallery page