[DF-3965] improve libJpeg wrapper