Nor was Jesus talking about the church being built on Peter. Jesus was talking about Himself (as the Son of God) as the foundation of the Church. Peter had just confessed his belief that Jesus was the Son of God. On that fact, Jesus' deity, would the church be built.
Matthew 16:16 - And Simon Peter answered and said, Thou art the Christ, the Son of the living God.
Matthew 16:18 - And I say also unto thee, That thou art Peter, and upon this rock [Jesus' deity] I will build my church; and the gates of hell shall not prevail against it.
Matthew 16:18 - And I say also unto thee, That thou art Peter, and upon this rock [Jesus’ deity] I will build my church; and the gates of hell shall not prevail against it.
But that is not all, Jesus also told Peter he was going to give him the keys to the kingdom, how could one apply with out the other also applying.