But God sent me ahead of you to preserve for you a remnant on earth and to save your lives by a great deliverance.
These words of Joseph could have been spoken by Jesus.
Paul writes to the Corinthians (1 Cor. 15:20) :
But in fact Christ has been raised from the dead, the firstfruits of those who have fallen asleep.
And later(1 Cor. 15:23):
But each in his own order: Christ the firstfruits, then at his coming those who belong to Christ.
Just like Joseph, Jesus too was handed over for evil purposes, but God had a bigger, glorious purpose behind what seemed so bad – saving a remnant. For Joseph on a national scale, but for Jesus on a cosmic scale.
Leithart has a good post here on more of Joseph as an image of Christ.