Fix Bug 1246

Use imagecreatefromstring replace imagecreatefrompng
See #1246