initial implementation of image insertion