Fix an error when there is no image matching the records.