   }
   
   public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
-    picker.dismiss(animated: true, completion: {
-        if let image = info[UIImagePickerControllerOriginalImage] {
-            self.photoHandler(image as! UIImage)
-        } else {
-            self.onError?(.other)
-        }
-    })
+    if let image = info[UIImagePickerController.InfoKey.originalImage.rawValue] {
+        self.photoHandler(image as? UIImage)
+    } else {
+      self.onError?(.other)
+    }
+    picker.dismiss(animated: true, completion: nil)
     self.popoverController = nil
   }
   

  internal weak var controller: UIViewController?
  
  var imagePicker: UIImagePickerController!
  func presentImagePicker(_ sourceType: UIImagePickerControllerSourceType, topController: UIViewController!) {
    imagePicker = UIImagePickerController()
    imagePicker.sourceType = sourceType
    imagePicker.delegate = self

        initialRequestOptions.resizeMode = .fast
        initialRequestOptions.deliveryMode = .fastFormat
        
        manager.requestImageData(for: asset!, options: initialRequestOptions) { (data: Data?, title: String?, orientation: UIImage.Orientation, info: [AnyHashable: Any]?) -> () in
          guard let dataImage = data else {
            errorHandler(.other)
            return
