Improve libgdiplus path handling