I am confused that Rasullah s.a.w said Ali and me is from one noor

The noor of prophet is created first then it divided into two.
And in this world our Prophet is last Prophet and Imam is the successor of our prophet.