             containerFrame.size.height = containerHeight
             collectionViewHeight = containerHeight - cameraButtonHeight
         }
-        containerView = UIView(frame: containerFrame)
+        containerView.frame = containerFrame
         containerView.backgroundColor = UIColor(white: 0, alpha: 0.4)
         view.addSubview(containerView)
         collectionView.frame = CGRect(x: 0, y: 0, width: containerView.bounds.width, height: collectionViewHeight)

    }

    func setupSubviews() {
        // Only create subviews once in the views lifecycle.
        // Views need to be added during viewDidAppear for the iPhone X's safeAreas to be known.
        if subviewsCreated { return }
        subviewsCreated = true

        previewView = UIView(frame: viewBounds)
        previewView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        view.addSubview(previewView)
        let previewLayer = captureManager.previewLayer

        collectionView.dataSource = self
        collectionView.delegate = self

        captureButton.frame = CGRect(x: (containerView.frame.width / 2) - cameraButtonHeight / 2, y: containerView.frame.height - cameraButtonHeight - 4, width: cameraButtonHeight, height: cameraButtonHeight)
        captureButton.layer.cornerRadius = cameraButtonHeight / 2
        captureButton.addTarget(self, action: #selector(capturePhotoTapped(_:)), for: .touchUpInside)
        containerView.addSubview(captureButton)
        captureButton.isEnabled = false
        captureButton.accessibilityLabel = NSLocalizedString("Take a picture", comment: "")

        closeButton.frame = CGRect(x: captureButton.frame.maxX, y: captureButton.frame.midY - 22, width: viewBounds.width - captureButton.frame.maxX, height: 44)
        closeButton.addTarget(self, action: #selector(doneButtonTapped(_:)), for: .touchUpInside)
        closeButton.setTitle(NSLocalizedString("Done", comment: ""), for: UIControlState())
        closeButton.tintColor = UIColor.white
