Bounded complexity justifies cooperation in the finitely repeated prisoners' dilemma