Fixes #5043 Photo uploading from ckeditor

This is a rebase of #5653, using the new .htaccess rules in master.

To test this you'll need to deactivate and reactivate ckeditor.