This expression is used when asking a musing or pensive person what they are thinking. It probably originated when a penny was worth something - perhaps a loaf of bread - and indicated that you were...
You can use imagine, think, visualize, envisage, envision, picture, see in the mind's eye; dream up, think up/of, conjure up, conceive, conceptualize or ideate.