         if(images.count==0){
             return;
         }
-        
         UIDevice.currentDevice().beginGeneratingDeviceOrientationNotifications()
         NSNotificationCenter.defaultCenter().addObserver(self, selector: "orientationChanged", name: UIDeviceOrientationDidChangeNotification, object: UIDevice.currentDevice())
         for v  in  self.view.subviews {

    }
    
    func handleDragGesture(sender: UIPanGestureRecognizer){
        if (scrollView.zoomScale != 1 || !gallery.dismissWhenSlidesUp){
            return
        }

                self.onDismissViewController!()
                
            }
            self.delegate?.galleryDidDismiss(self)
        })
        
    }
