1. Place original APPLE 3.1.3 via iTunes to the phone
(when Error in Itunes happens, kick it out of recovery with tinyUmbrella)
...then you will have Wifi again on your phone
2. Go over wifi on you phone to
www.jailbreakme.com
3. When Cydia is installed, make unlock with ultrasnow.
Then you will have FW 3.1.3 with BB 6.15
Maybe you can try this with FW 4.0, 4,1 , but higher versions are not supportet on jailbreakme.
For my phone with works 100%. Before no IMEI, no nothing....