Take snapshots from webcam stream or canvas in html5