Your MP
Name: Mike Wood
Party: Conservative
Constituency: Stafford
Err, Stafford has been Labour since the last election, and before that it was a Conservative, but it was Theodora Clarke. Mike Wood is MP for Kingswinford and South Staffordshire.Surely the way you build something like this is a postcode -> constituency table (I assume available free), a constituency -> mp table, and mp -> image generation (with caching or generate multiple versions)
Even if the lookup data mis-selected the constituency (I think some postcodes can straddle constituencies), surely the Constituency/Name/Party would be consistent.
I'm guessing you're using chat-gpt for the entire program?