hun
You will have to modify the code quite a bit to add a native inline image function on signatures like the Reply box has. Or you can simply attach the image that’s being deleted to something (like a Ticket) so an attachment record is created and it’s not cleaned up by the orphaned file purge. Or you can do what I suggested above and instead add the images to the Response/Reply template above/below the %{signature}
variable.
The other image is likely not deleted because it’s attached to something elsewhere. You should be able to find an attachment record in the DB that correlates to that specific file.
Cheers.