Middleware for Photo Indexing (currently working on sqlite)