Updated images rename function