construct function has been added and It's take the directory where the images need to stored