All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is obligatory on the polygamous husband to deal justly with his wives.
Allah Says (what means): {But if you fear that you will not be just, then [marry only] one.} [Quran 4:3]
The Prophet said: “If a man has two wives and does not deal justly with them, he will come on the Day of Judgment with half of his body bent over.” [Ahmad, Abu Daawood, An-Nasaa-i and Ibn Maajah]
If the wife bears the oppression of her husband, she will be rewarded for it. She can put her case before a court and ask for divorce if she feels that her husband is not treating her justly.
A marriage that is conducted without witnesses and Wali (guardian) is an invalid marriage.
So, if a marriage is concluded without its normal conditions (Wali, witnesses, dowry...), it has to be established again with all of the above conditions. Your first marriage is then considered a doubtful marriage. In this case, the marriage of an Imam or that of someone else has no bearing on its validity.
Allah knows best.