Juste update the gist, with all examples based on @christianm scenarios:
Here a screenshot of the rendering, with the current patch applied, there is some JS in the snippet to allow more easy review of the final image width / height and if the image is the original one or a thumbnail:
Last review for me, and the PR is ready to be pair reviewed. Maybe at some point we can use something like PhantomCSS to check for regression.
Edit: updated the screen shot with TS + Fluid rendering