Is there something that you plan to do within the for loop?
I realise that you'd like to know why the inline images are lost but if you don't plan to do anything with it, just change the subject, then they aren't required,and I'd just delete them.
If you do plan to do something with all the items then post that, because perhaps there may be another way to do it that doesn't cause this issue.
Sometimes, especially in Notes, you don't get an answer as to why, just ways to stop it from happening...