fixed a bug in the mnist loading code where non-consecutive digits could not be loaded