extracting images for saving them locally