Changed image to NSData to allow for writing to local file system