Fixed memory leak in jpeg loading.