OTA(HTTP.Update) Failsafe

hi, i am using ESP8266 12E as a add on for my project, its working as slave mode and master send the data over SPI and it send to my server.
i am using Arduino core and updating via server. i faced once that OTA update is not successful and esp goes into non firmware mode, so i had to upload manually via serial at that time.
is any method to download the firmware in its 4M flash and if ok then start it other wise reject it and start the older one ?

Thanks in Advance