     $(document).on 'click', '.js-gallery-thumbnail', @switchPreview
 
     $(document).on 'turbolinks:before-cache', ->
-      $('.pswp--open').remove()
+      $('.js-gallery--container').remove()
 
 
   initiateOpen: (e) =>

      timeToIdle: null

    if _.startsWith(galleryId, 'contest-')
      new _exported.GalleryContest(@container[0], pswp)

    pswp.init()




  open: ({galleryId, index}) =>
    container = @container[0].cloneNode(true)
    container.classList.add 'js-gallery--container'
    document.body.appendChild container

    pswp = new PhotoSwipe container,
      PhotoSwipeUI_Default
      @data galleryId
      showHideOpacity: true
