Sure, use placeholder {$AverageRating}. It keeps a numeric value of the average rating, like „4.2“.
You just have to create some image for every possible number, like stars-4.2.png, stars-4.3.png, stars-4.4.png and so on and place them on your server. Then use the placeholder like this:
<img src="public/path/on/your/server/stars-{$AverageRating}.png">
Got it? 😉