fixed handling of build arch in .img hooks