use createimagefromstring to solve the image format problem caused by morons