It would be generally recommended you also include a
<noscript><img src=""></noscript>
section for crawlers and other visitors without JavaScript turned on. I would have at least hoped your solution would use the element rather than a completely non-standard
approach to display images.
Not sure what library, provider or script you are using but maybe check out a responsive image service like Pixtulate who would actually allow you to use a standard img tag and still accomplish what you are looking to do.