Better error handling for thumbnails