Fix image upload issue with unknown media types

Also fixes overly persistent images in the post view.