     }
   }
 
-  private func cancelCurrentImageDrag(_ animated: Bool) {
+  private func cancelCurrentImageDrag(_ animated: Bool, duration: TimeInterval = 0.7) {
     animator?.removeAllBehaviors()
     attachmentBehavior = nil
     isDraggingImage = false

      imageView.transform = .identity
      recenterImage(size: scrollView.contentSize)
    } else {
      UIView.animate(withDuration: 0.7,
                     delay: 0,
                     usingSpringWithDamping: 0.7,
                     initialSpringVelocity: 0,

  }
  
  func recenterAfterRotation() {
    cancelCurrentImageDrag(true, duration: .transitionAnimationDuration)
  }
  
  func recenterImage(size: CGSize) {
