cc-d: Updated os specific thumbnail generation function to be cross platform, misc code changes/cleanup

    no comments