Two bug fixes

Fixed a bug that occurred during aspect ratio clustering if the number of images was less than the number of clusters.

Fixed a bug that occurred during threshold optimization if there were no additional synsets available to take negative samples from.