Only insert the photo in the database if no record exists

If one wants to update the meta data in the database, one needs to delete the database file, and run the script again.