added a new function to delete files corresponding to specific image and corrected bug in Initialization that was causing a lot of recomputation