magnetlib: beautify imagePath