Would a divorce only be final with the exact imam who married us was was present? Or can any Imam divorce us?

Divorce is in your own hands, and you are the one who conducts it, by telling your wife (You are divorced), provided that she is not menstruating, nor in the purity during which you had intercourse with her, and it is stipulated that there be two just witnesses.
As for the presence of an imam, it is to obtain a certificate stating that the divorce took place