It looks like you have:
multipart/related
-> text/html
-> image/jpeg
I've also had trouble in the past sending email with the top part being multipart/related. Try this instead:
multipart/mixed
-> multipart/related
--> text/html
--> image/jpeg
Also, make sure and set the disposition on the image like this:
img.add_header("Content-Disposition", "inline", filename="myimage")