Added function to convert an image into a stream.
Merge branch 'common' into ui