Failsafe email does not contain the Content-Disposition specified in the headers for the attachment, so you skip it. It looks like you will have to relax the if , which checks the Content-Disposition a bit.
Maybe you could just see if you see the Content-Type image / jpeg and work with it.
j0057 source share