improving JPEG writing in ImageWorker
Merge pull request #153 from simboss/8.x-jpeg

improving JPEG writing in ImageWorker