adding title attribute to 'a' tags and alt attribute to img tag