classic ui: Fix incorrect behaviour of getcgivars() -- #5276

fixed confusion between "key" and "value" in the large key-comparison
if/else if ladder that kept iamges from being generated correctly.

refs: #5276
whatthecommit: Asleep at the switch again, I see...