             return false
         }
 
-        if let currentItem = referenceSlideshowController.slideshow.currentSlideshowItem , currentItem.isZoomed() {
+        if let currentItem = referenceSlideshowController?.slideshow.currentSlideshowItem, currentItem.isZoomed() {
             return false
         }
         

    }
    
    func handleSwipe(_ gesture: UIPanGestureRecognizer) {
        let percent = min(max(fabs(gesture.translation(in: gesture.view!).y) / 200.0, 0.0), 1.0)
        
        if gesture.state == .began {

    open var referenceImageView: UIImageView?
    /// parent slideshow view used for animated transition
    open var referenceSlideshowView: ImageSlideshow?
    // must be weak because FullScreenSlideshowViewController has strong reference to its transitioning delegate
    weak var referenceSlideshowController: FullScreenSlideshowViewController?
    var referenceSlideshowViewFrame: CGRect?
    var gestureRecognizer: UIPanGestureRecognizer!
    fileprivate var interactionController: UIPercentDrivenInteractiveTransition?
