Attach click handler to images