Remove trailing slash from urls
Check Content-Type before downloading, remove illegal characters from file name