So I was able to get this to work by adding this to my functions.php in WordPress to return the images by passing the url. Hopefully it will help someone else who is getting the CORS error trying to return images to another site:
add_action( ‘rest_api_init’, function () {
register_rest_route( ‘loadImage’, ‘/content/’, array(
‘methods’ => ‘GET’,
‘callback’ => ‘fetchImage’,
) );
} );
function fetchImage($data) {
$url = $data->get_param(‘url’);
$info = getimagesize($url); // get image data
header(“Content-type: “. $info[‘mime’]); // act as image with right MIME type
readfile($url); // read binary image data
die();
}