[fix bug 928959] Convert image to RGB before saving as JPEG.
Merge pull request #676 from glogiotatidis/928959

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