Gallery3 - Fix script addition for filtered 'square' galleries