UIIMagePickerController not working properly with Swift 3
<p>I'm getting crazy with this.</p>

<p>While migrating a simple UIIMagePicker implementation I have everything working properly , no issues, no warning.
Running on both simulator and device the PickerController just don't take into consideration the new image and won't apply to the UImageView.</p>

<p>This is my code:</p>

<pre><code>@IBOutlet weak var profilePictureImageView: UIImageView!
let picker = UIImagePickerController()

override func viewDidLoad() {
    super.viewDidLoad()   
    picker.delegate = self
    }

//Opening Camera to take a new picture
@IBAction func takeNewPictureButtonDidTouch(_ sender: AnyObject) {
    if UIImagePickerController.isSourceTypeAvailable(.camera) {
        picker.allowsEditing = false
        picker.sourceType = UIImagePickerControllerSourceType.camera
        picker.cameraCaptureMode = .photo
        picker.modalPresentationStyle = .fullScreen
        present(picker,animated: true,completion: nil)
    } else {
        noCamera()
    }
}

//Opening the library to select an existing picture
@IBAction func openPicturesLibraryButtonDidTouch(_ sender: AnyObject) {
    picker.allowsEditing = false
    picker.sourceType = .photoLibrary
    picker.mediaTypes = UIImagePickerController.availableMediaTypes(for: .photoLibrary)!
    picker.modalPresentationStyle = .popover
    present(picker, animated: true, completion: nil)
    }

//MARK: - Delegates
func imagePickerController(_ picker: UIImagePickerController,
                           didFinishPickingMediaWithInfo info: [String : AnyObject])
{
    var  chosenImage = UIImage()
    chosenImage = info[UIImagePickerControllerOriginalImage] as! UIImage //2
    profilePictureImageView.contentMode = .scaleAspectFill //3
    profilePictureImageView.image = chosenImage //4
    dismiss(animated:true, completion: nil) //5
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
    dismiss(animated: true, completion: nil)
}

func noCamera(){
    let alertVC = UIAlertController(
        title: "No Camera",
        message: "Sorry, this device has no camera",
        preferredStyle: .alert)
    let okAction = UIAlertAction(
        title: "OK",
        style:.default,
        handler: nil)
    alertVC.addAction(okAction)
    present(
        alertVC,
        animated: true,
        completion: nil)
}   
}
</code></pre>