Avoid loop if no result + go back to start when all photos have been shown