There was a wrong assert in Texture::setImage() as well as a typo when calling setImage() itself in the sample code.