.thm and .db files are created by windows when exploring your folders, they contain thumbnails and if deleted they should be created automatically again next time you browse this same folder. So yes it's perfectly safe to delete them.
.ini are configuration files, probably created by a 3rd party tool (maybe a picture viewer or something similar), they are viewable and editable by hand, so you can just open them with notepad to see what's in them (the prgram creating them might be indicated). It's most likely safe to delete them too, they probably contain information about your pictures like metadata / tags and similar.
But I doubt you'll gain much space by deleting those, they should be very light (a few kb). A better method would be to use a better format for your pictures if possible. If your photos come from your camera or scanner, they might be saved in a lossless format, which usually take a lot of space. Check their extensions on wikipedia or google to see if I'm right.
Good formats for photos are JPEG (best compression, but loss in quality) and PNG (no loss in quality). For personal photos I would go for JPG and try various compression ratios. Don't worry too much about the loss in quality, it's barely noticeable when setup right. Even at the highest quality (100), you should notice a major size reduction from a lossless format. If all your photos are already in JPEG, then don't bother recompressing, you would definitely lose in quality.
You should also take a look at the wikipedia entry on JPG to get an idea of its capabilities, it has samples of photos with various compression and their sizes : JPEG - Wikipedia, the free encyclopedia
I think you'll be fine deleting those files and let Windows re-create them, the process to re-create them shouldn't take too long depending on the speed of your hard drive and the size of the individual jpeg, bmp or png photo files you have but I wouldn't do too often since it usually does take time to re-create them all unless you edit your photo files very often and want the latest thumbnails to be displayed when browsing within those folders.
As oneeyed mentioned above you will not gain a lot of space from purging the thumbnails cache, personally I don't do it cause I'm not a photo or video editor thus I do not need the latest thumbnails to be displayed when browsing such media files and folders on my secondary storage hard drive and external drive.
Another reason why I don't delete the thumbnail cache on my drives is particularly for very large video files (I like my video files to be displayed as thumbnails) every time you purge the thumbnail cache it takes a very long time for Windows to re-create them on slower mechanical hard drives and if you have a lot of video files like I do that you do not edit then it's really pointless to purge it, I would even go as far as to not include the thumbnail cache when cleaning my drives out for free space with Windows Disk Cleanup or CCleaner software.