Code refactor

Moving creating TakePictureTask object to separate method. Removing DRY.