Clean up export_png and export_svg functions