Make sure to store relative file paths in DB
Make sure the file listing of the image dir contents in the database contains only relative file paths. Make this code cross-platform.