The problem is not your code, but the variable s. She is empty when you use brackets in the td fields.
So this works
<img src="" alt="you want to check" />
and this not
<img src="" alt="you want to check" />
But the working version doesn't show up the images of course
