Security checks on uploads

We handle this on upload now:

If you upload something that we are unable to figure out is an image then we reject it. We also correct bad file extensions, eg if you upload a png and it really is a jpeg we will fix that. And a bunch of other refinements since we first did work here.