Read each image into an Image class instance.
Use the
Image.GetThumbnailImage[
^] method to create the thumbnail.
You can then use the Image.Save method to create files.
(But personally, I'd do it the other way - store thumbnails in the DB along with a location specifier for the full image. Images can take up significant DB space and bandwidth!)