Simply fetch the data through this URL:
userid_here with id of the user you want to get the photo of. You can also use HTTPS as well.
You can use the PHP's
file_get_contents function to read that URL and process the retrieved data.
php.ini, you need to make sure that the OpenSSL extension is enabled to use the
file_get_contents function of PHP to read that URL.