Added text pre-processing (for invalid chars)
Added save as JPEG