use type of image as file extension