[fix bug 928959] Convert image to RGB before saving as JPEG.