     var rightConstraint: NSLayoutConstraint!
     var topConstraint: NSLayoutConstraint!
     var bottomConstraint: NSLayoutConstraint!
+    var oldFrame: CGRect = CGRectZero
+    
+    //MARK: - Initializers
     
     public convenience init() {
         self.init()

        }
        
        // Update min/max scale
        if targetScale > self.minimumZoomScale {
            self.minimumZoomScale = targetScale
        } else if targetScale > self.maximumZoomScale {
            self.maximumZoomScale = targetScale

        self.zoomScale = targetScale
        
        // Update Constraints
        self.updateImageConstraints()
    }

    func updateImageConstraints() {
        guard self.image != nil else {
            return
        }
        // Calculate Padding
        let horizontalPadding = max(0, (self.frame.width - self.image!.size.width * self.zoomScale)/2)
        let verticalPadding = max(0, (self.frame.height - self.image!.size.height * self.zoomScale)/2)
        
        // Update Constraints
        self.topConstraint.constant = verticalPadding
        self.bottomConstraint.constant = verticalPadding
        self.leftConstraint.constant = horizontalPadding
