server side base64 encoding images and reading now on client