fixed file in use by other process error

I also changed the API class so it returns an object instead of a list
of URLs. Text posts with images in them are now saved as well.