updated main and JpegEncoder
Merged