Fixed some issues for multiple galleries. Might have to convert plugin to OOP