Updated thumbnail code