Thumbnails Tutorial AS Adjustment for Thumb Width

I’m wondering if there is a way to tweak the tutorial for the thumbnails slider (link below) to allow for thumbnails of various widths:

Currently the script creates the spacing between the thumbs by taking the width of the first thumbnail loaded and adding a value of 5 to it. However, in my instance the first thumb is the widest, so this creates odd spacing (This is for a product selector that runs from largest thumb to smallest).

Any help would be greatly appreciated…