Yes Jaw pain Near TMJ can diagnosed with OPG xray. Sometime require CBCT .
And Definitely your pain due to cavities.
A cavity can result in jaw pain when the tooth deteriorates to a point where the tooth root becomes infected. This infection can spread to tissues in the jawbone which can cause severe pain .
Next Steps
Visit nearest dentist for proper diagnosis
Health Tips
Take Antibiotics and pain relievers.