ci: improve image build (#1679)