fixes #4519 Cannot set image to null on existing contents