Be aware that I give you no guarantee !
I got something, not sure if it’s enough to fix your problem.
It should work directly on your Sailfish phone, but I prefer to modify the database on a computer then copy it on my phone.
# First go to the directory where commhistory.db is stored
cd ~/<path>/commhistory/
# Do a copy for security
cp commhistory.db commhistory.db.backup
# Then download the script :
wget https://gist.githubusercontent.com/pherjung/476f3881e15498b4ab545416db58afb5/raw/3fcabe83a7006bb4159c9edf26a010a5dc50164c/convert.py
# Give him executable right
chmod u+x convert.py
# Execute it
./convert.py
It will replace every entry in the table MessageParts with nemo to defaultuser.
Once you transferred the database to your phone, be sure to set the good owner and group with
chown defaultuser:privileged commhistory.db