Allow width()/height() in more circumstances.

If you've set the width/height on an image layer, there's no harm in parroting
it back to you, even if you have not yet set the image.

I also improved the error messages on some other null checks.