Update ImgUtil.java

Add decoder and encoder.