Found a way of decoding an image in js - base64 encodeing no longer required