 
 open class PhotoCaptureViewController: UIViewController, PhotoCollectionViewLayoutDelegate {
     open weak var delegate: PhotoCaptureViewControllerDelegate?
-    open var imagePickerAdapter: ImagePickerAdapter? = ImagePickerControllerAdapter()
+    open var imagePickerAdapter: ImagePickerAdapter? = ImagePickerControllerAdapter() {
+        didSet {
+            updateImagePickerButton()
+        }
+    }
 
     /// Optional view to display when returning from imagePicker not finished retrieving data.
     /// Use constraints to position elements dynamically, as the view will be rotated and sized with the device.

        closeButton.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
        containerView.addSubview(closeButton)

        if imagePickerAdapter != nil {
            let pickerButtonWidth: CGFloat = 114
            pickerButton = UIButton(frame: CGRect(x: view.bounds.width - pickerButtonWidth - buttonMargin, y: buttonMargin, width: pickerButtonWidth, height: 38))
            pickerButton.setTitle(NSLocalizedString("Photos", comment: "Select from Photos buttont itle"), for: UIControlState())
            pickerButton.setImage(UIImage(named: "PhotosIcon"), for: UIControlState())
            pickerButton.addTarget(self, action: #selector(presentImagePickerTapped(_:)), for: .touchUpInside)
            pickerButton.titleLabel?.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.footnote)
            pickerButton.autoresizingMask = [.flexibleTopMargin]
            pickerButton.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
            roundifyButton(pickerButton)
            view.addSubview(pickerButton)
        }

        previewView.alpha = 0.0
        captureManager.prepare { error in


    fileprivate func updateWidgetsToOrientation() {
        var flashPosition = flashButton.frame.origin
        var pickerPosition: CGPoint = pickerButton?.frame.origin ?? .zero
        if orientation == .landscapeLeft || orientation == .landscapeRight {
            flashPosition = CGPoint(x: buttonMargin - (buttonMargin / 3), y: buttonMargin)
            pickerPosition = pickerButton != nil ? CGPoint(x: view.bounds.width - (pickerButton!.bounds.size.width / 2 - buttonMargin), y: buttonMargin) : .zero
        } else if orientation == .portrait || orientation == .portraitUpsideDown {
            pickerPosition = pickerButton != nil ? CGPoint(x: view.bounds.width - (pickerButton!.bounds.size.width + buttonMargin), y: buttonMargin) : .zero
            flashPosition = CGPoint(x: buttonMargin, y: buttonMargin)
        }
        let animations = {
            self.pickerButton?.rotateToCurrentDeviceOrientation()
            self.pickerButton?.frame.origin = pickerPosition
            self.flashButton.rotateToCurrentDeviceOrientation()
            self.flashButton.frame.origin = flashPosition
            self.closeButton.rotateToCurrentDeviceOrientation()
