Of course, if you can reliably detect some media types such as "image/jpeg" or "image/png", correcting them would be great. Use "application/octet-stream" as a default value for those you were unable to detect.
If you do specify a correct media type in "new Attachment(...)" call, some mail apps might treat the attachment differently from "application/octet-stream" - for example, they might show a thumbnail of the image. (Basically, "application/octet-stream" indicates a binary file with unspecified format.)