Just in case, the general phenomenon happening here is that you've got two instantiations of the image library (I believe that mrlib/image-core is the essential one that's getting duplicated in this case) so there are two different sets of structs for the representation of images and the one doesn't recognize the other.
There are two basic approaches, I guess: you could run everything image-related inside the sandbox (including, I suppose, turning it into a bitmap or svg or something) and then getting it out of the sandbox, or you could share the implementation of the image library between the inside and outside of the sandbox. The former approach is more secure but maybe less convenient; the latter is the other way around.
If you wanted to share the implementation you'd have to set up the sandbox not with a fresh namespace, but with a namespace that already has the same instantiation of mrlib/image-core as the one you want to use outside the sandbox.
Robby