Fix SSO avatar downloading issues.

* Follow redirects when downloading SSO avatars.
* Add proper image ext. to downloaded SSO avatars.
Merge pull request #2708 from Wilhansen/sso_override_avatar

Fix SSO avatar downloading issues.