added code to extract patches from image, refactored some
updated dependencies