Fix IOOB when importing MIFs (see #10772)

This is a quick fix for the issue. A general review of the logic has to happen soon.

To test, try importing any multi-file images on develop (gretzky).