Fix issue where mails with inline images of the same name contained only the first image multiple times (#1489406)