Snap photo from webcam by using HTML5 and JavaScript