Generates training and test data from metadata file; normalizes image if required.
Support functions to normalize image
Refactored