Use cURL if possible, use getimagesize instead of exif function if it's not available.