Do you know which files have changed from the database tables? For example, something in the database indicates that the item is new or modified? Then it is easy to populate a list of files to check. Are the files ever modified or are they only added (and deleted)? Then you don't need to check modified times, just if the files exists or not.
The contents of the table may change, but the pictures will not. So one day one there may be 1000 database records and then the next there may be only 940, then the following day there could by 1120 with the difference all being new records.
So each day I have to delete and repopulate the table and then check to see if I have the pictures or not.
Then you can look at the files on the local machine and decide which ones to download. You don't need to check that for files that have been modified. And you don't need to scan through all the files on the server.
The basic algorithm I would follow is construct a list of files from the new database. Then scan through the list, checking for files that exist on the local machine. Then fetch all the files that weren't found.