add MNISTImage file to the dirtory
define cost compute function