Custom behaviour or javascript to save a lot of repetition

Well, without having tested … you can load images dynamically (look at this thread e.g.) You can set the url to the image as an HTML-Attribute (like I did it with the letters)