Use list comprehension in DatabaseBackend.get_thumbnails.