updated thread to continuously take pictures