fixing encoding and doing escaping on alt and title text in more places