fix out of fds condition when indexing images.
fix make master-deb
Merge branch 'master' into testing