Updated thumbnail script to have size limit