Fix error when there is no thumbnail for an image