What you want is possible with the BerryIMU, in theory.
Regarding heading, you would need to include tilt compensation, which our code has.
If you are out and about when you take your photos, then you would only need to calibrate it once for hard iron distortion, this page as some info on this. https://ozzmaker.com/compass3/.
When you say ‘declination’, are you talking about the deviation from the true vertical or horizontal? If “yes”, the gyro and accelerometer can give you these values.
I assume you will have a button to press to capture this data whenever a photo is taken?
Mark --OzzMaker.com --