Further fixes to attachment ordering fixer

When using the 'copy ordering from a previous edition', we need
to handle the case that new attachments have been added in a
later edition. These added attachemnts should be placed at the end.
Merge commit '4a805cec78c2f79ce03d7a13138b5609dd0f4f91' into HEAD