Could it be okay for me to take painkillers?

It could. You need to have a discussion with a doctor about this. They will need to know a detailed medical history, give you an exam, and then discuss the risks and potential benefits of painkiller use. Set aside at least 30 minutes to spend with a doctor you trust.