capture image from the webcam at fixed interval