build toggling thumbnail expansion

some refactoring so it works better - no more errors, only loads the new image once, follows proper structure of the images, etc