Wireless sensor network (WSN) comprises a set of sensor nodes, mainly used for data collection and tracking process. The imaging sensors in WSN captures the images from the target environment, which needs to be securely transmitted to the base station (BS). Since data transmission in WSN takes place through wireless links, security is a major challenging issue involved in the design of WSN. Image encryption is a commonly available solution to securely transmit the images to destination without comprising security. Therefore, this study designs a novel Chaotic Butterfly Optimization with Optimal Multi-key Image Encryption (CBO-OMKIE) technique for WSN. The goal of the CBO-OMKIE technique is to securely encrypt the images in WSN. The proposed CBO-OMKIE technique involves the design of multi-key based image encryption technique to accomplish security in WSN. In addition, the CBO algorithm is applied to determine the optimal keys involved in the encryption process and it helps for improving the security level to a maximum extent. The performance validation of the CBO-OMKIE technique takes place using benchmark test images and the outcomes were examined under several aspects. The simulation outcome pointed out the enhanced security analysis of the CBO-OMKIE technique over the other techniques.