In the call to gfapi.upload_photo, just specify the file name (in the same directory) as photo_url.
So instead of gfapi.upload_photo(listing.id, photo_url, 0), you would do gfapi.upload_photo(listing.id, photo_filename, 0).
This function takes either URL or photo (as you can see in the code).