wrlib: separated the code to save to XPM from the builtin XPM loading