Maybe it's not too late, I just want to share my trick.
Just put the invocation code in an element, and modify the width/height on parsing.
<div id="some-id">
<script type='text/javascript'>
// invocation code here
</script><noscript><!-- bla bla --></noscript>
</div>
<script>
$(document).ready(function () {
var img = $('#some-id').find('img');
if (typeof (img) !== 'undefined' && img.length > 0) {
$(img)
.removeAttr('width')
.removeAttr('height')
.addClass('img-responsive'); // eg: twitter bootstrap
}
});
</script>
On this case, I didn't care about the downloading size, but only how it's being presented.
Still, the original width + height should exactly match with the zone's size.