A dictionary will get you the assignment behavior you desire:
imheight = {}
But if you later need to iterate over it in some order, this won't be as easy as if you'd done it as a proper list of lists, since dictionaries don't maintain order. However, this may work well enough.