fix query in image delete
be consistent in naming
fix label queries
improve label queries