Wipe system partition and then flash the new image along with all the other things that you usually flash through TWRP (Magiak, gapps, patches for bug fixes, etc..)
You may face some problems like a bootloop, I recommend to first make a backup for all your data through TWRP.