Make error handling more consistent in img_create() and img_resize()