fix jpeg loading