Having issues going back to stock on shield portable

i recently bought a shield portable the 1st version and it has a custom rom on it i would like to go back to stock like it was brand new from the shop. as i dont have any button mapping or use of nvidia stuff on the shield i have tryed flashing the factory.img but i get a error message saying FAILED ( command write failed (no error)) if any of you kinds guys and gals could do anything to help me i would be so gratful i have tryed everything i know of through my expreience of rooting phone and such but this is past what i know. and lastly i am sorry if i have posted this in the wrong place i did have a look around and really wasnt sure where to leave my post
thanks in advance guys

craig