Can't reinstall an app uninstalled through ADB
The solution can be found in the question Reinstall System app which is uninstalled for the current user? (which is unanswered):

adb shell cmd package install-existing com.android.gallery3d


Note this doesn't work in Android 5 (hence the other question), as the cmd command was only added later (I don't remember exactly when, but it's available in Android 7 at least).