[PATCH v3 10/25] image: Move common image code to image_board and command