improved exception handling, added operation mode option, fixed yuv conversion, added size methods