fixed bug: InputStream of originalIamge read twice