fixes #8513 - removing n+1 query from images#index