Parsing mnist and turning into something more appropriate (library helper).