O zaman önce resmi uzak sunucudan çekmek lazım. En basit haliyle bu şekilde yapabilirsiniz.
<?php
 
try {
 
    $baglanti = new PDO("mysql:host=localhost;dbname=SANSÜR", "SANSÜR", "SANSÜR");
    $baglanti->exec("SET NAMES utf8");
    $baglanti->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
    $sorgu = $baglanti->query("SELECT * FROM users WHERE username = '".htmlspecialchars($_GET["username"])."'");
 
    $cikti = $sorgu->fetch(PDO::FETCH_ASSOC);
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $cikti["avatar"]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $resim = curl_exec($ch);
    curl_close($ch);
    header("Content-Type: image/png");
    echo $resim;
    exit;
 
} catch (PDOException $e) {
    die($e->getMessage());
}
 
$baglanti = null;
 
?>