add functionality where by events can be attached to images dynamically