Make jpeg conversion synchronous