Fixed issue when setting the material to an image