The size check for ppc64.img was happening before the file was generated. This fixes that, hopefully.
The first patch is a big gnarly whitespace change, because it's hard enough to figure out what's going on in this script when the if blocks line up right. Replaced all the tabs with spaces since that was probably half the problem anyway.