It occurs to me now that you should probably add a simple test to make sure that title.textContent is at least 4 characters long. If not, just return without modifying anything.

As the code stands, if the width of the thumbnails was reduced to something narrower than the width of the ellipsis, I think we'd enter an infinite loop here where each change converts the string to \u2026 and triggers another overflow event.