It was believed that there were 12 imams after Muhammad
The twelfth imam was said to have gone into hiding to avoid prosecution
The Twelve Shiites still believed he was alive and would one day return
Ismail's father ordered his followers to wear red hats with twelve pleats to remember the Twelve Shiites imams
The Safavids used propaganda that claimed that Ismail was the twelfth imam or even went as far to say that he was the incarnation of Allah.
Most people did not believe it, but the Qizilbash accepted it because it went along with their ideals
They believed Ismail would make them invincible
Here are the 12 imams. If payed close attention to, it is possible to see that the last man one the left has no face. This is the Twelfth imam who went into hiding.
This is Ismail, who was said to be the twelfth imam and the incarnation of Allah.