Yes, a stomach x-ray can detect pregnancy in certain cases, but it is not the preferred method. A pregnancy test is more accurate and safer.