added some middleware functionality and simple image upload
added some middleware functionality and simple image upload