This happened to me to just on my iPod 4G. You are kinda in trouble. I hope for your sake that it is not what I think. When it happened to me I did not even do a hard reset. Instead I took it to a retailer. I knew the person who works their and said that he was not really supposed to tell me this but a small trojan in the form of a HTML 5 code can disable your firewall on your ios device. And that flashing and distorted screan is when ios is giving a fight and is when the trojen installs itself. A hard reset makes the phone look OK but pretty much all of your data could be leaked. My advice is to backup your device and put it in DFU mode. In DFU mode your device will restored and formatted. This worked for me and did not experience this again. But before you backup your device erase all history cookies caches etc and restart then backup and send your device into DFU.
To enter DFU mode: Plug your iphone into your computer you last backed it up with.
Make sure your device is recognised your Mac/PC.
Turn it off.
Then hold the power buttone for 3 seconds.
Then hold down the home button and the power button for 10 seconds. MAke sure you hold down both the power and home button.
Then release the power button and hold the button for 15 seconds.
iTunes will then say a device has been inserted that needs to be restored. Click restore and wait.
This worked for me.
Please feel free to ask any other questions.