update for getting original image while training