* 3.1.x:
[ticket/14437] Make sure attachments array is properly ordered before processing
[ticket/14437] Preserve attachment ID order by ordering by attach_id
[ticket/14437] Sort attachments after assigning inline attachments
[ticket/14437] Correctly assume index from attachment display order