It sounds like your downloads were interrupted thus resulting a corrupted file.
You can try to download using your web browser from this direct link for iOS 7.0.4 iPhone 5 GSM - 11B554a OR iPhone 5 GSM+CDMA - 11B554a. (Identify your iPhone 5 model from this link or from the image below and download the appropriate file) Once the download completes can you check the file size to ensure the download was not interrupted, actual file size should be 1.32GB.
You can restore your phone using iTunes. Press Option on your keyboard and click Restore simultaneously, it will pop up a window to locate the downloaded firmware. Select the firmare and let the phone restore.
Hope this helps.