added addFile and removeFile functionality to image.js