imaging: remove some map function and fix sqlalchemy warning

About sqlalchemy warning: don't request if in_ predicate is empty