All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
There is nothing wrong with keeping, selling, or distributing books of knowledge that contain useful images, if the one who obtained it wants to benefit from it scientifically because those images was not the reason for buying them. This is unfortunately one of the pervasive afflictions and it is difficult to avoid it. Among the established jurisprudential rules is that hardship brings ease and that what is valid when connected to other things is not valid independently. The buyer of those books wants the information and benefits they contain, not those pictures.
As for digital imaging, it is a matter of difference of opinion among scholars. The opinion that we adopt here at Islamweb is that it is permissible and that it is not considered forbidden photography.
Allah knows best.