About Base64 has nothing to do with "16 bits". As the name implies, your message is broken into 64-character representative pieces, i.e.: 6 bits. Using this subset of the 256-character (8-bit) total table ensures that the data is all represented by visible and printable characters. This ensures that any content can be, for example, copied and pasted into user applications: cryptographic key pairs use this representation feature, for example.
It also ensures that any content will always be transmitted in full, even by Internet protocols that only transmit pure text.. This was the case with the early versions of the email patterns, for example. Even today, when an image is attached in an email, it is attached internally as Base64 or some variant (base85, for example). In your email inbox there may be an option to "view original message", or "raw" - select this and see how images, type signatures come encoded as Base64.
In Python, to decode a chunk of data in Base64 and similar there is a module ready in the standard library that already does everything, called "Base64". Just call the function base64.b64decode
passing its coded text, and will have the original content in the form of an object "bytes". Just save this object as a binary file on disk to get the image file:
dados = {"imagem": "iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAAAAADhOQgPAAAAI0lEQVQI1yXGsQ0AMBDEIO7339kp0iDWiJMMSa6Fr3WYtn4ev0gPAtGQ50YAAAAASUVORK5CYII="}
import base64
imagem = base64.b64decode(dados["imagem"])
with open("image.png", "wb") as img_file:
img_file.write(imagem)
To have 64 symbols, the format uses the letters A to Z uppercase and lowercase (52 characters), plus the digits from 0 to 9 (64) and the symbols + and /, totaling 64 digits. The "=" sign is still used to mark "0" numbers that do not enter the decoded data, when the number of original bytes is not divisible by 3. Thus, each 3 8-bit bytes of the original message is converted to 4 6-bit digits. Line breaks are ignored, allowing data to be formatted so that it can be printed in a "cute way".