refined saving function
image saving works
added a stupidly awesome thumb function