Factor out icon image loading code