syncs attachments and deletes empty folders