the ultra sonic waves can just pass through the cracks then how does it reflect back
For cracks to be detected, the size of the cracks should match the size (of wavelength) of the sound wave incident on them. Generally, in materials, the cracks dimensions are very small (of the order of a a few microns or less) and thus can only be detected using a sound of smaller wavelengths.
This is the reason why longer wavelength sound waves (ultrasounds) are not used.
Cracks do not reflect low frequency sound wave but reflects higher frequency.
Doctors use ultrasound to view abnormalities in internal human organs such as liver, gall bladder, uterus, kidney, etc. They pass ultrasonic waves into the patient’s body. These waves move through the body and are reflected by a region where abnormalities such as stones, tumour, etc. are present. These reflected waves are received by a computer. The computer generates the picture of the given organ on the monitor.This technique is known as ultrasonography.