         
         view.hidden = true
         pagingScrollView.alpha = 0.0
-        
-        let fadeView = UIView(frame: CGRect(x: 0, y: 0, width: screenWidth, height: screenHeight))
-        fadeView.backgroundColor = .blackColor()
-        fadeView.alpha = 0.0
-        applicationWindow.addSubview(fadeView)
+        backgroundView.alpha = 0
         
         if let sender = delegate?.viewForPhoto?(self, index: initialPageIndex) ?? senderViewForAnimation {
             
             senderViewOriginalFrame = (sender.superview?.convertRect(sender.frame, toView:nil))!
             sender.hidden = true
             
-            let imageFromView = (senderOriginImage != nil ? senderOriginImage : getImageFromView(sender)).rotateImageByOrientation()
-            let screenScale = applicationWindow.frame.width / applicationWindow.frame.height
-            let imageScale = imageFromView.size.width / imageFromView.size.height
+            let imageFromView = (senderOriginImage ?? getImageFromView(sender)).rotateImageByOrientation()
+            let imageRatio = imageFromView.size.width / imageFromView.size.height
             let finalImageViewFrame:CGRect
             
             resizableImageView = UIImageView(image: imageFromView)

    public func performCloseAnimationWithScrollView(scrollView: SKZoomingScrollView) {
        
        view.hidden = true
        
        if let sender = senderViewForAnimation {
            senderViewOriginalFrame = (sender.superview?.convertRect(sender.frame, toView:nil))!
        }
        
        let fadeView = UIView(frame: CGRect(x: 0, y: 0, width: screenWidth, height: screenHeight))
        let contentOffset = scrollView.contentOffset
        let scrollFrame = scrollView.photoImageView.frame
        let offsetY = scrollView.center.y - (scrollView.bounds.height/2)

    
    // tool for controls
    private var applicationWindow: UIWindow!
    private var backgroundView: UIView!
    private var toolBar: UIToolbar!
    private var toolCounterLabel: UILabel!
    private var toolCounterButton: UIBarButtonItem!
