use isModified to find out whether we should remove old versions of attachments