Encode image to data:URL : Use content type from HTTP headers.

* Encode image to data:URL : Use content type from HTTP headers.
* Don't require file to be saved to be able to encode fully qualified URLs.