Add some protection against corrupt images in Set thumbnail.