Updated sdcard image generation script

Now a bit more stable. Generates an image that is easily writeable to an SD card via dd.