Fix global and local settings for image gallery jQuery wrapper