Generate a captcha image from a text in JavaScript