Never mind, we have recreated the problem on joomla.
Here is what's happening - After having installed the new codebase, when user's session expires (may be due to short session lifetime), and when user tries to re-login, the code does a re-sync and tries to check if logged-in contact has any image_url set (in contact_type table as per new code) which results in throwing that error.
Here are the workarounds till we come out with any code fix -
Workaround - 1
==========
As soon as you see the error, doing a page reload should bring the upgrade screen back. And hitting upgrade button should work normally.
- OR -
Workaround - 2
==========
Before installing the new codebase increase the session lifteime, so that session doesn't expire between installing the new codebase and hitting the upgrade.
Note: Session lifetime could be increased from Global Configuration >> Session Settings >> Session Lifetime. Change the session timeout back to previous one, once you done with upgrade.
Let us know how this works for you.