WL-3056 Make sure we have sensible bounds on size.

We don't want someone to be able to have a negative image size or a size so large we start running out of memory.