Add options to build and update_img scripts. Also fix bugs in Link.ld.