When someone gives you a pep talk it is to build you up to help you accomplish something. In sports a coach might give a player a pep talk before the game to bolster his confidence. At work the boss might give you a pep talk to get you to do a better job.
A photo finish is when two contestants (usually in a race) finish at almost exactly the same time, making it difficult to determine the winner. (The saying stems from the practice of taking a photograph when the winners cross the finish line to determine who was ahead at the time.)