i need an image upload script that lets users upload an image to my website

need it to have:

Size check > allow certain sized files to be uploaded

extention check > only allow certain extentions .jpeg, .png ect...

i want it to creat a thumbnail callery on a certain page too

if anyone could dop this or give me info on how to do this please let me know