Taking snapshot using html5 and javascript