adding global state flag and moving the zeroing out of the image to where it is also written
add basic js html webcam page