 
     fileprivate func updateWidgetsToOrientation() {
         var flashPosition = flashButton.frame.origin
-        var pickerPosition = pickerButton.frame.origin
+        var pickerPosition: CGPoint = pickerButton?.frame.origin ?? .zero
         if orientation == .landscapeLeft || orientation == .landscapeRight {
             flashPosition = CGPoint(x: buttonMargin - (buttonMargin / 3), y: buttonMargin)
-            pickerPosition = CGPoint(x: view.bounds.width - (pickerButton.bounds.size.width / 2 - buttonMargin), 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 = CGPoint(x: view.bounds.width - (pickerButton.bounds.size.width + buttonMargin), y: buttonMargin)
+            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.pickerButton?.rotateToCurrentDeviceOrientation()
+            self.pickerButton?.frame.origin = pickerPosition
             self.flashButton.rotateToCurrentDeviceOrientation()
             self.flashButton.frame.origin = flashPosition
             self.closeButton.rotateToCurrentDeviceOrientation()

    fileprivate var containerView: UIView!
    fileprivate var focusIndicatorView: UIView!
    fileprivate var flashButton: UIButton!
    fileprivate var pickerButton: UIButton!
    fileprivate var closeButton: UIButton!
    fileprivate let buttonMargin: CGFloat = 12
    fileprivate var orientation: UIDeviceOrientation = .portrait

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

        updateImagePickerButton()

        previewView.alpha = 0.0
        captureManager.prepare { error in
