add method to add image dynamically