additional improvements in cleanAttachmentURI handling of malformed uris and formatting corrections