Use html classes for img sorting instead of ids.