adding a function to store images