Fail with error message, if TextureInfo is invalid

If you've been wondering why I'm spamming PRs that improve the debugging experience, this is the reason :)

I managed to mess up TextureInfo yet again, which results in an assertion failure way down the line, too far from the source of the error to be of any help. This took a while to figure out, but I hope the work that resulted from it will prevent others from similar ordeals in the future.

Fixes #256.