start of image extracting process, added function to bookfunctions