add format-as-stream-by-mime-type

Needed a format function in which i can pass in mime-types. I thought it would fit well having this in the image-resizer code.