Looks like the way that you get the various sizes has changed again in Gutenberg and we now need to use the media_details object. Something like:
However i get this error:
Uncaught TypeError: can't access property "sizes", img.media_details is undefined
Any thoughts where I am going wrong?