javascript code to capture image from web camera