Join log + image + definition db to only one