A Wireless Sensor Network (WSN) consists of programmable, low-cost and resource-constrained nodes. Adding new features or error fixes requires reprogramming nodes. Manually reprogramming hundreds or thousands of nodes is impractical as it takes significant effort and time. Therefore, WSNs require a mechanism for updating the nodes program image, which contains the applications and protocols running on each node. Current protocols for updating program images rely on a large external memory that is used to temporary store program images. In this paper we present the design, implementation and experimental measurements of a lightweight and reliable Program Image Dissemination Protocol (PIDP) for autonomous adhoc multihop WSNs. PIDP requires no external memory storage, is independent of the WSN stack, offers a low overhead protocol for transferring program images, and can reprogram the whole WSN stack. An update procedure with PIDP in one part of the network does not interfere with the WSN elsewhere. PIDP was implemented on a node platform with an 8-bit 2 MIPS Microchip PIC18LF8722 microcontroller and a 2.4 GHz Nordic Semiconductors nRF24L01 radio. PIDP requires less than 7 kilobytes of program memory and from 22 to 815 bytes of data memory. In experiments PIDP reprogrammed a campus WSN, which is a running deployment of 178 nodes, in 5 hours.