capturing an image using webcam