Also you could just do `currentElement.addClass('gallery-frame-loaded');` as it's already a jQuery object.