Solved problem with image_metrics and class_extension function