Main window: Doc/Page import: Code cleanup

Signed-off-by: Jerome Flesch <jflesch@gmail.com>
Backend: pdf.nb_pages: Avoid a nasty exception when the document has just been deleted

Signed-off-by: Jerome Flesch <jflesch@gmail.com>
Backend: docimport: indexation is now done from the frontend

Signed-off-by: Jerome Flesch <jflesch@gmail.com>
Main window: PDF import: Fix: don't try to set the image on a pdf

Signed-off-by: Jerome Flesch <jflesch@gmail.com>