Fixed wrong file path and inversion function for the inverted images to be converted and saved correctly.