More work on bug #8138.  Image uploading now works.