 
     let messageImagePreferredAspectRatio: CGFloat = 4.0 / 3.0
     
-    let imagePicker = UIImagePickerController()
+    lazy var imagePicker: UIImagePickerController = {
+        let imagePicker = UIImagePickerController()
+        imagePicker.delegate = self
+        imagePicker.mediaTypes = [kUTTypeImage, kUTTypeMovie]
+        imagePicker.videoQuality = .TypeMedium
+        imagePicker.allowsEditing = false
+        return imagePicker
+        }()
 
     let chatSectionDateCellIdentifier = "ChatSectionDateCell"
     let chatStateCellIdentifier = "ChatStateCell"


            let openCameraRoll: ProposerAction = { [weak self] in
                if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.PhotoLibrary){
                    if let weakSelf = self {
                        weakSelf.imagePicker.delegate = weakSelf
                        weakSelf.imagePicker.sourceType = .PhotoLibrary
                        weakSelf.imagePicker.mediaTypes = [kUTTypeImage, kUTTypeMovie]
                        weakSelf.imagePicker.videoQuality = .TypeMedium
                        weakSelf.imagePicker.allowsEditing = false
                        
                        weakSelf.presentViewController(weakSelf.imagePicker, animated: true, completion: nil)
                    }
                }
            }

                default:
                    if currentState == .MoreMessages {
                        strongSelf.hideKeyboardAndShowMoreMessageView()

                        // touch to create (if need) for faster appear
                        strongSelf.imagePicker.hidesBarsOnTap = false
                    }
                }

