fix : only open connection for images if not in local 

+ better handling of errors
Merge pull request #353 from tyrcho/fixes

urgent fix : only open connection for images if not in local
another test for #345
Merge branch 'master' of https://github.com/HearthStats/HearthStats.net-Uploader