Finished re-write of OptimalSizeForTexture().  Removed first version code in OptimalSizeForTexture().