With Base64 possible to encode everything, text or binary data, such as PNG. To store it you should first decode it. But, if your image in DataURI format, first, you have to get only base64.
set b64=$piece(png,"base64,", 2)
To encode Base64 in Caché you can use $system.Encryption.Base64Encode(), and $system.Encryption.Base64Decode() to decode.
But these methods support only string and does not support streams. So, you have to write this encoded data, to your file content. Do not forget to use Binary stream classes (%Stream.FileBinary, %Stream.GLobalBinary) to store binary information.
But if your Base64 too long, you can decode by parts with length divisible by 3.