Make image scanning over MTP go faster

Still no thumbnails, but with these patches the image scan at least completes quickly.

The branch includes the testsuite fixes from PR#16