Quality assessment of whole-slide images through artifact detection