fixed saving images with double file extension