better db test.
refactored for deployments.
check if all images are in the database.
get rid of old logs instead of keeping them.
fix bugs from code rot.
merge