improved mnist support for random minibatches