I'm using this http://www.ghosthorses.co.uk/production-diary/removing-inline-img-dimensions-for-responsive-wordpress-websites/ to remove the height and width attributes of images. Everything works fine except that it messes up the masonry container because of the images have no height. How could I apply this filter only to a determined div id/class?
You might have better luck using wp_get_attachment_url( $id ) rather than wp_get_attachment_image(). Take a look at the WordPress codex for the call.
As I guess what you're after (and which is off topic here), I'll briefly explain what is...
So this code will produce no images in IE:
But this will:
Summed up briefly: The idea is to set one image and surround it with a div that has a background image.
That's the only contra with this solution.