Add correct file extension to post