         case .Changed:
             let transform = targetView.transform.a
             targetView.transform = CGAffineTransformMakeScale(scale, scale)
-        case .Ended , .Cancelled :
-            if scale < 1.0 {
-                self.moveImageToCenter()
-            } else {
-            }
+        case .Ended , .Cancelled:
+            let center = targetView.center
+            self.adjustBoundsAndTransform(targetView)
+            self.adjustImageViewFrame()
         default:
             _ = 0
         }
+        self.debug()
     }
     
     func close() {

                completion()
        }
    }
}

                    }, completion: { (_) -> Void in
                        self.close()
                    })
                } else {
                    self.adjustImageViewFrame()
                }
            }
        default:
            _ = 0
        }
        self.debug()
    }
    
    func imagePinched(recognizer:UIPinchGestureRecognizer) {
