Good modification first of all, but i have a slight issue with your SQL modification. The modification will work just fine, but your description is not correct. As far as i can see from my database and from the system, the date field represents the date the image was added - not taken. But since the ID field is the primary key for the table, the modification will work perfectly.
I will incorporate your SQL change into the next release, and if you have any other modifications i will be happy to add them also if they can be of general interest.