Fixed a crash on Mac when generating thumbnails during import