modifications in functions for save and update images
changes and updates in functions for save and update images