How can I set value of text panel to display image based on the value from influx?

I saw this post Add graphic to the dashboard
where I see how to set an image, however I want to have a panel display image based on the value set in the influxdb meansurement.

so if I have an image being displayed as so if value from influx is sunny.jpg it should show me sun if the value is cloud.jpg it should show me clouds and so on.