Added divide by zero check in zoom calculation