Fix: fetching URLs with spaces

When fetch_file_contents() is called with a URL that contains spaces (such as when caching images locally), curl only reads the URL up to the first space. This fix replaces space characters in the URL with '%20' to get around this.