Fixed typo in adding of the attachments

Each attachment without the name (not sure it's possible) will have same generated name `attachment0` without this fix.
How does this prevent `$attachmentIndex` from still not being **0** for each iteration? Does this been to be incremented below?