Encoding and conversion to bufferedimage are working