             // Move target view
             if let targetView = recognizer.view {
                 let variation = recognizer.translationInView(targetView)
-                targetView.center = CGPointMake(targetView.center.x + variation.x, targetView.center.y + variation.y)
+                targetView.center = CGPointMake(targetView.center.x + variation.x * targetView.transform.a, targetView.center.y + variation.y * targetView.transform.a)
                 
                 let velocity = recognizer.velocityInView(targetView)
             }

                    }, completion: { (_) -> Void in
                        self.close()
                    })
                } else {
                    self.moveImageToCenter()
                }

                self.imageView.frame.size = CGSizeMake(width, height)
                self.imageView.center = self.window.center
                }) { (_) -> Void in
                    self.imageView.bounds.size = self.imageView.frame.size
                    self.imageView.transform = CGAffineTransformMakeScale(1, 1)
            }
        }
    }
