Writing to xml file, cleans up image name