Included thumbnail processing code