Fixes #5043 Photo uploading from ckeditor

This is a rebased version of #5176

To do:
- [x] Use new file matrix class
- [x] clean up admin view
- [x] use is_uploaded_file()