moved image code to npc base classs