Conversion to bw image fixed
Momentum (in training) implemented