Yes, the 2nd photo, on its own, is misleading. One first thought would be of an AA cell. Though Alkaline AAs have a littlty ridge at the bottom, and capacitators have not. But AA NiMh batteries have a flat bottom too.
Anyway, as indicated above, it is for sure a flash capacitator.
My advice:
Unless you are sure the salts are stretchind to the opposite side of the capacitator, I just would clean its botton, the battery compartments and its contacts and leave it as is for the rest.
Otherwise, or if a battery contact has been damaged that it no longer works, the camera has to be disassembled. You then might solder-in a self-made contact or clean the top of the capacitator and everything else from the salt. Be aware that if you have put in new batteries and switched on the camera before, the capacitator will be charged again with something like 300V !!
You might even change the capacitator for good as they are not getting better by time. Such small one should be cheap.
In this case check the size, the voltage and capacity. Get one that is designated "Flash". Check the way (polarity) of the original one (there is a mark at its cover) and solder-in the substitute the same way. Of course this implies that you know how to solder electronics parts.