write correct extensions on image uploader

This fixes an issue where all uploaded images had an extension of `.png`.