uh, sorry if my post is confusing. No the code in my post is a copy of the original situation, with inline attachments basically repeating the last one (attachment=0).
Possible explanation for it is that you added a file with "add files", then clicked on "place inline", then you "add files" again and "place inline" again and so on. Every time you a attach a file, it goes last in the attachment list and it takes the number 0, thus the others are renumbered, but the editor does not change the numbering that's already placed in the edited message.
I don't want to sound more confusing
but if you play a bit by editing your messages and [attachment=X] numbers maybe you'll see what I'm trying to describe
Sorry for the off-topic