build toggling thumbnail expansion - lots of refactoring so it works better