I'm not sure I get what you're doing here. In your third code box you only return some JSON data, you don't render anything so there are no templates or template loops involved at that point. Are you saying that this call $('#my-reaction' + postId).attr('src', reactionImage); changes the src attribute of the img to an empty string?

[SOLVED] I sent the html through the controlller file to my page, stops the empty img src for invalid html mark up for now.
A bit more experience in jQuery and the new extension stystem will come with time