The Gemara here states that one may not gaze at images even on a weekday, as this is a violation of the Torah’s prohibition (Vayikra 19:4): אל תפנו אל האלילים — Do not turn to false gods. The Gemara explains that gazing at images is subsumed under this prohibition because the phrase may be read: אל תפנו אל מדעתכם — Do not turn to that which you create from your own thoughts.
Ramban (to Vayikra loc. cit.) explains the prohibition further, and states that it warns us not to belief that other deities can provide us with any benefit, nor to believe predictions that the prophets of these deities foretell. Rather, you must realize that the future is dictated by Hashem alome, and the other gods and all that is attributed to them must be null and void in your eyes. It is in this context, continues Ramban, that the Gemara asks us to avoid gazing at representations of other deities, as a person should avoid focusing his attention on any deity other than Hashem.
In the same vein, Shem MiShmuel (Parashas Veyeileich, 5672) writes that the statement (Devarim 31:18): וְאָנֹכִי הַסְתֵּר אַסְתִּיר פָּנַי בַּיּוֹם הַהוּא עַל כָּל הָרָעָה אֲשֶׁר עָשָׂה כִּי פָנָה אֶל אֱלֹהִים אֲחֵרִים — And I will surely conceal My countenance on that day on account of all the evil that he did, for he turned to other gods — does not refer to pantheistic or pagan worhsip. Rather, it refers to a person who did not sanctify himself sufficiently — to a person who was not meticulous in refraining from gazing at the images of other deities. In this manner Shem MeShmuel resolves the difficulty presented by the pesukim in Parashas Vayeileich: If the Jews have already done teshuvah, as indicated by the previous pesukim, why does Hashem continuee to conceal himself?
The answer is that they did teshuvah on the major sins, and that suffices to save them from perishing in Galus, but they did not turn away from the images of the countenances of other gods. Hence, measure for measure, Hashem conceals His countenance from them.
Shem MeShmuel concludes: וזה לימוד גדול לאדם לידע שבימי התשובה העיקר לקבל על עצמו להיות מקדש עצמו במותר לו מהיום והלאה וידאב לבו על העבר ולא תהי' די לו הקבלה על גופי המצוות, וישכיל וידע עד היכן הדברים מגיעים — And this is a great lesson, to know that in the days of teshuvah, the main thing is to accept upon oneself to refrain even from that which is [technically] permitted [such as gazing at images] from today onwards, and his heart should regret the past. For it does not suffice to accept resolutions on the mitzvos themselves. And a person should consider and know to what extent these matters [of teshuvah] reach.