You can use file_get_contents
to grab the image data and file_put_contents
to save the image to your file system. Then modifying the JSON is as easy as changing the value in the JSON decoded array, then re-encoding it.
//example for JPEG image
$image = file_get_contents($imageUrl);
file_put_contents('MyImage.jpg', $image);