handling file extensions encoding and image_serving