Fixed an issue where existing attachments are discarded on saving.