fix missing return of stream
let image directory use database
add image database persistence
add image persistence in database
add missing header for image persistence