There are tons of similar threads in these forums - use search button at the right top corner and then search by keyword "image thumbnails".
But to be more informative then preaching 🙂 : you have a couple of options. First would be to upload detailed images and then, when user asks for a thumbnail - create thumbnail from image in server's memory and then serve it to the user. This still takes some time for php to read detailed image and resample it, but it saves bandwidth, as only a thumbnail is sent. Second option, the fastest, is to creeate thumbnails while uploading. Then you have both detailed and thumbnail image on server disk, ready to be served when user asks for it. There is a disk space issue, but if you're going to store detailed images anyway, comparing to that, storing thumbnails won't take much space. The third and the worst option is to forget about thumbnails and use width and height atributes of img tag. This doesn't save any bandwidth nor gives satisfactory results with image resizing.