Convert vector images into valid inputs for grImport and grImport2