extract_patches function

Extract image patches and return a list