Add detection of MIME types, and properly notify AWS on upload