Fix getInstrinsic{Width,Height} when using resources

Also make sure we only use the error/errorResource width/height when an error has occurred.