Fix bug that causes an error when there is only one thumbnail