Images: Check ordering before order_by() to reduce queries

I introduced a regression in d45b201b where applying order_by() would
bust the prefetching done by ProductManager, resulting in way too many
queries on e.g. a product list page.

This can be avoided by only applying order_by if necessary.