backward compatibility for buildimage

i'm sorry that the previous pr #70 broke the backward compatibility of the code,fix it now.