removing temporary files when using external image loader and on upload