split photo_file.scan and thumbnails cache directory into smaller pieces, bugfixes to image files filename matching