Exporting functionality. Does not work entirely as expected on retina screens (images are exported twice as large as the should be)