Improve and make safe export view to image

* Must dispose of clipboard!
* Create ImageData before other things in case it doesn't have enough memory