Fixed javascript bug makes duplicate function in image editor redirects to wrong path