Allows to specify different Python base image when building images (#24634)