Fix image caching for URL containing whitespaces