For some background information and an explanation of what this series of posts is about, see here. Part 2 of the series is here.
The Gospel Of Thomas
"Matthew would be one of the most obscure of the Twelve had not a Gospel been attributed to him. The saying in the Gospel of Thomas  must presuppose the existence of Matthew's Gospel and its attribution to Matthew. By citing Matthew's view of Jesus it is deliberately denigrating the Gospel of Matthew and upholding the superiority of the Gospel of Thomas with its sayings derived from Thomas. This is confirmed by the fact that Matthew's description of Jesus as 'like a wise philosopher' is quite appropriate as a reference to Matthew's Gospel. In no other Gospel is Jesus' ethical teaching as prominent as it is in Matthew's. In the ancient world ethics was the domain of philosophers, and an ethical teacher like the Jesus of Matthew could well be described as 'a wise philosopher.' The Gospel of Thomas itself is only minimally concerned with ethics. If Matthew in this passage represents Matthew's Gospel, then it becomes highly likely that Peter represents Mark's Gospel....[other scholars] think that, by referring to Matthew and Peter, the Gospel of Thomas intends reference to the figure of Peter in Matthew's Gospel, especially to Matt 16:16-19." (Richard Bauckham, Jesus And The Eyewitnesses [Grand Rapids, Michigan: Eerdmans, 2006], pp. 236-237 and n. 102 on p. 237)
The Ebionites, a heretical group of the second century who used an altered version of the gospel of Matthew (Irenaeus, Against Heresies, 1:26:2), apparently attributed that document to Matthew:
"In the Gospel that is in general use among them [the Ebionites] which is called 'according to Matthew', which however is not whole and complete but forged and mutilated - they call it the Hebrews Gospel - it is reported: 'There appeared a certain man named Jesus of about thirty years of age, who chose us. And when he came to Capernaum, he entered into the house of Simon whose surname is Peter, and opened his mouth and said: 'As I passed the Lake of Tiberias, I chose John and James the sons of Zebedee, and Simon and Andrew and Thaddeus and Simon the Zealot and Judas the Iscariot, and you, Matthew, I called as you sat at the receipt of custom, and you followed me. You, therefore, I will to be twelve apostles for a testimony unto Israel.''" (Epiphanius, Panarion, 30:13:2-3)
Justin refers to "the memoirs which I say were drawn up by His apostles and those who followed them" (Dialogue With Trypho, 103). Notice the plural: "apostles" and "those who followed them". The use of the plural matches our four gospels: apostles (Matthew, John) and those who followed them (Mark, Luke). Justin doesn't cite the number four anywhere, but his comments are consistent with the collection of four gospels that sources living just after Justin's time refer to. In another place, Justin refers to the apostles' composition of gospels (First Apology, 66), so he can't just be referring to the apostles as the subject matter of the gospels. On one occasion, he cites a passage from the gospel of Mark, mentions Peter in the process, and refers to the source as "the memoirs of him" (Dialogue With Trypho, 106). The "him" probably refers to Peter, not Jesus, since elsewhere Justin repeatedly associates the gospels (which he often calls "memoirs") with the apostles and their associates, not Jesus. Thus, Justin seems to have been aware of the concept that Peter was Mark's primary source. Notice that Justin's comments about the memoirs of Peter and some of his other comments cited above come from his Dialogue With Trypho. The document was written around the middle of the second century, but Justin places his discussion with Trypho in the 130s. According to Justin, such gospel attributions were known to him within a few decades of the apostolic era, and he says nothing of any questioning of those attributions by his Jewish opponents at the time.
According to Origen (Commentary On John, 6:2), Heracleon (a heretic of the second century) referred to the fourth gospel as written by "the disciple". Origen had the apostle John in mind, and he makes no suggestion that Heracleon disputed that attribution.
Celsus, a pagan who wrote against Christianity in the second half of the second century, referred to the gospels as written by "the disciples" (cited in Origen, Against Celsus, 2:13-16). The phrase "the disciples" is more naturally taken as a reference to the apostles, not disciples in a more general sense. Origen, who had a copy of Celsus' treatise, interprets him that way, and he nowhere has to interact with an argument from Celsus against the traditional authorship attributions. As we'll see later, Origen makes a comment, in this same passage, about how the apostolic authorship of the gospels isn't disputed by the Jewish opponents of Christianity whom Celsus is citing.