adding event listeners to images