merge media and db