fix progressive crash problem for jpeg