I have a Samsung Galaxy S5 phone with a broken screen. I'm trying to get a full system image that I can then flash into a brand new Samsung Galaxy S5. 

I know that it is possible to clone one phone's system and configuration into another phone (e.g. using the procedure described [here](https://android.stackexchange.com/questions/127952/is-it-possible-to-clone-a-phone-then-flash-image-on-other-phones)). However, that process assumes a fully working source phone.

How could I extract a functioning, flashable system image from a phone with no screen?

FYI: the source phone has USB debugging enabled, so it is possible to access it through adb.