added a new thread for loop that continuously takes pictures