As salaam aalaikum,
Many Shias say that being an "imam" is greater than being a prophet. They normally quote the following verse where Ibrahim (pbuh) prays to be an "imam" after he became a prophet.
And [mention, O Muhammad], when Abraham was tried by his Lord with commands and he fulfilled them. [Allah] said, "Indeed, I will make you an imam for the people." [Abraham] said, "And of my descendants?" [Allah] said, "My covenant does not include the wrongdoers." (Quran 2:124)
But in the following verse I feel that any Muslim believer can be an imam.
And those who say, "Our Lord, grant us from among our wives and offspring comfort to our eyes and make us an imam." (Quran 25:74)
From the above verse it seems that any Muslim can make the dua of being an "imam". Even Ibrahim (pbuh) was making a similar dua.
Furthermore, if we start reading the above verse in context of the 4-5 verses before, we notice it talks about repentance and turning a persons life around from sin and then making this dua to be an imam.
This simply implies that ANY sinner who turns his life around can make dua to be an "imam" as opposed to the concept of infallibility of imams.
So how does one bring together the idea that an "imam" is greater than a prophet when any Muslim can make dua to be a imam?
I would prefer Shia view, but the others are welcome to chime in.