file and image uploading fixes