make jpeg loading use minimal memory