If system.img is too big
I had trouble using fastboot to flash the system partition. System.img was too large and I was having trouble getting the environment up to build the sparse image.
My boot and recovery partitions were, however, set up to successfully boot TWRP recovery. I booted into TWRP, then I used adb to transfer the system.img to the internal storage.
adb push system.img /sdcard/
The I went into adb shell and used dd to write the image.
dd if=/sdcard/system.img of=/dev/block/platform/omap/omap_hsmmc.1/by-name/system
Once this completed, I rebooted and the stock environment was in place.