imagenet verify
moved the image manipulation code to a separate function