Whitespace cleanup
Remove a broken line of code

This wasn't having any actual effect on the output.  Note the
misspelling of "attechment".
Refactor out get_part_url() calls
Detect the MIME type if a useful one was not provided.