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