             messageObject.roomy = Roomy.current()
             messageObject.senderName = Roomy.current()?.username
             messageObject.houseID = House._currentHouse
-            messageObject.text = text
+            messageObject.text = modifiedText
+            
+            if let pictureFile = pictureFile {
+                messageObject["picture"] = pictureFile
+            }
             
             messageObject.saveInBackground { succeeded, error in
                 if succeeded {

        }()
        let imagePicker = UIImagePickerController()
        
        if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) &&
            (UIImagePickerController.availableMediaTypes(for: .photoLibrary)?.contains(type) ?? false) {
            imagePicker.mediaTypes = [type]

    }

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        
        print("Try again")
        
        let picture = info[UIImagePickerControllerOriginalImage] as? UIImage
        self.sendMessage(text: "", video: nil, picture: picture)
        
        picker.dismiss(animated: true, completion: nil)
    }
