You'll need to utilize some form of server-side scripting language, be it Perl (CGI), PHP, ASP or CF .... take your pick, really. Perl and PHP are free and available on virtually all paid hosts and many free ones.
You'll finid all kinds of pre-made counters in a variety of languages at
www.hotscripts.com - also, basic counters are simple to make and would be a good practice exercise if you're interested in learning one of those languages.
If you get a pre-made counter, then you can probably just replace the default images with your own, assuming, of course, you download one that uses images/modify the existing code so that it does use images.