added logic to turn base64 into a file that paperclip can use