Limit image size we try to flash to memory size
Limit image size we try to flash to memory size

This is important as without this check, the VLA in the
next scope can try to allocate a massive area for a big
file and will overrun the stack.

lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator