[ticket/11534] Check remote avatar content type using curl if possible

This should make sure that error pages like 404 or 503 pages are not treated
as remote avatar images.

Ticket: http://tracker.phpbb.com/browse/PHPBB3-11534

PHPBB3-11534