Mostly working now... need to fix issue where thumbnails are being named incorrectly.