Fix bug where no thumbnail throws an unhandled exception