Added jpegOptimisation in doResize function