Welcome to the forum! I'm surprised your gasteroenteroligist has not discontinued mesalamine entirely to see if it clear up your Pericarditis. Mesalamine-induced-Pericarditis is a rare side effect but can happen with some. Discontinuation of mesalamine is recommended. It's a rare side effect but can happen.
There's other non-mesalamine medications available to treat UC, like immunomodulars azathioprine/6MP, and biologics like remicade/humira.
Here's some links to medical journal entries about
UC patients treated with mesalamine who had Mesalamine-induced-Pericarditis. It's so rare many gasteroenteroligist offices have never encountered it at their practice. Possible they may not know how to handle it!
www.sciencedirect.com/science/article/pii/S1878540914000681/www.ncbi.nlm.nih.gov/pmc/articles/PMC3006104//www.ncbi.nlm.nih.gov/pubmed/11898896