Fix a bug in removing cid img without attachments