[BUGFIX] Prevent division by zero when scaling image