fix bad attachment urls and encode them
Merge pull request #635 from pdvyas/hotfix-attachment-url

fix bad attachment urls and encode them